#define _CRT_SECURE_NO_WARNINGS 1

#include"SList.h"

void test1()
{
	SL* plist = NULL;
	PushFront(&plist, 2);
	PushFront(&plist, 1);
	PushBack(&plist, 3);
	PushBack(&plist, 4);
	PushBack(&plist, 5);
	PopFront(&plist);
	PopFront(&plist);
	PopBack(&plist);
	PopBack(&plist);
	Print(plist);
}

void test2()
{
	SL* plist = NULL;
	PushFront(&plist, 2);
	PushFront(&plist, 1);
	PushBack(&plist, 3);
	PushBack(&plist, 4);
	PushBack(&plist, 5);
	/*PopFront(&plist);
	PopFront(&plist);
	PopBack(&plist);
	PopBack(&plist);*/

	SL* pos = SlSearch(plist, 3);
	if (pos)
	{
		//printf("%d\n", pos->data);
		PushInsertFront(&plist, pos, 20);
		PushInsertAfter(pos, 30);
		PushInsertAfter(pos, 80);
		Print(plist);

	}
	//Print(plist);
}

void test3()
{
	SL* plist = NULL;
	SL* pos = SlSearch(plist, 3);

	PushInsertFront(&plist, pos, 20);
	PushInsertFront(&plist, pos, 80);
	PushInsertFront(&plist, pos, 100);
		/*PushInsertAfter(pos, 30);
		PushInsertAfter(pos, 80);*/

	/*PushFront(&plist, 2);
	PushFront(&plist, 1);
	PushBack(&plist, 3);
	PushBack(&plist, 4);
	PushBack(&plist, 5);
	PopFront(&plist);
	PopFront(&plist);
	PopBack(&plist);
	PopBack(&plist);*/
	Print(plist);
}

void test4()
{
	SL* plist = NULL;
	PushFront(&plist, 2);
	PushFront(&plist, 1);
	PushBack(&plist, 3);
	PushBack(&plist, 4);
	PushBack(&plist, 5);
	/*PopFront(&plist);
	PopFront(&plist);
	PopBack(&plist);
	PopBack(&plist);*/
	SL* pos = SlSearch(plist, 1);
	assert(pos);
	if (pos)
	{
		PopInsertAfter(pos);
		PopInsert(&plist, pos);

		Print(plist);
	}
	//Print(plist);
}

void test5()
{
	SL* plist = NULL;
	PushFront(&plist, 2);
	/*PopFront(&plist);
	PopFront(&plist);
	PopBack(&plist);*/
	PopFront(&plist);
	
	Print(plist);
}

int main()
{
	test5();
	return 0;
}